package com.config;

import com.entity.SmsEntity;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.stereotype.Component;

public class ImportBeanDefinitionRegistrarConfig implements ImportBeanDefinitionRegistrar {
    /**
     * @param annotationMetadata 注解信息
     * @param beanDefinitionRegistry bean的基本信息
     */
    @Override
    public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry beanDefinitionRegistry) {
        // 手动注册信息到ioc
        RootBeanDefinition rootBeanDefinition = new RootBeanDefinition(SmsEntity.class);
        beanDefinitionRegistry.registerBeanDefinition("smsEntity",rootBeanDefinition);
    }
}
